// source --> https://www.absorve.com.br/site2019/wp-content/plugins/cookie-law-info/public/js/cookie-law-info-public.js?ver=2.1.2 CLI_ACCEPT_COOKIE_NAME = (typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy'); CLI_PREFERNCE_COOKIE = (typeof CLI_PREFERNCE_COOKIE !== 'undefined' ? CLI_PREFERNCE_COOKIE : 'CookieLawInfoConsent'); CLI_ACCEPT_COOKIE_EXPIRE = (typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365); CLI_COOKIEBAR_AS_POPUP = (typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false); var CLI_Cookie = { set: function (name, value, days) { var secure = ""; if (true === Boolean(Cli_Data.secure_cookies)) { secure = ";secure"; } if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else { var expires = ""; } document.cookie = name + "=" + value + secure + expires + "; path=/"; if (days < 1) { host_name = window.location.hostname; document.cookie = name + "=" + value + expires + "; path=/; domain=." + host_name + ";"; if (host_name.indexOf("www") != 1) { var host_name_withoutwww = host_name.replace('www', ''); document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name_withoutwww + ";"; } host_name = host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".") - 1)); document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name + ";"; } }, read: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1, c.length); } if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length, c.length); } } return null; }, erase: function (name) { this.set(name, "", -10); }, exists: function (name) { return (this.read(name) !== null); }, getallcookies: function () { var pairs = document.cookie.split(";"); var cookieslist = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="); cookieslist[(pair[0] + '').trim()] = unescape(pair[1]); } return cookieslist; } } var CLI = { bar_config: {}, showagain_config: {}, allowedCategories: [], js_blocking_enabled: false, set: function (args) { if (typeof JSON.parse !== "function") { console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); return; } if (typeof args.settings !== 'object') { this.settings = JSON.parse(args.settings); } else { this.settings = args.settings; } this.js_blocking_enabled = Boolean(Cli_Data.js_blocking); this.settings = args.settings; this.bar_elm = jQuery(this.settings.notify_div_id); this.showagain_elm = jQuery(this.settings.showagain_div_id); this.settingsModal = jQuery('#cliSettingsPopup'); /* buttons */ this.main_button = jQuery('.cli-plugin-main-button'); this.main_link = jQuery('.cli-plugin-main-link'); this.reject_link = jQuery('.cookie_action_close_header_reject'); this.delete_link = jQuery(".cookielawinfo-cookie-delete"); this.settings_button = jQuery('.cli_settings_button'); this.accept_all_button = jQuery('.wt-cli-accept-all-btn'); if (this.settings.cookie_bar_as == 'popup') { CLI_COOKIEBAR_AS_POPUP = true; } this.mayBeSetPreferenceCookie(); this.addStyleAttribute(); this.configBar(); this.toggleBar(); this.attachDelete(); this.attachEvents(); this.configButtons(); this.reviewConsent(); var cli_hidebar_on_readmore = this.hideBarInReadMoreLink(); if (Boolean(this.settings.scroll_close) === true && cli_hidebar_on_readmore === false) { window.addEventListener("scroll", CLI.closeOnScroll, false); } }, hideBarInReadMoreLink: function () { if (Boolean(CLI.settings.button_2_hidebar) === true && this.main_link.length > 0 && this.main_link.hasClass('cli-minimize-bar')) { this.hideHeader(); cliBlocker.cookieBar(false); this.showagain_elm.slideDown(this.settings.animate_speed_show); return true; } return false; }, attachEvents: function () { jQuery(document).on( 'click', '.wt-cli-privacy-btn', function (e) { e.preventDefault(); CLI.accept_close(); CLI.settingsPopUpClose(); } ); jQuery('.wt-cli-accept-btn').on( "click", function (e) { e.preventDefault(); CLI.acceptRejectCookies(jQuery(this)); }); jQuery('.wt-cli-accept-all-btn').on( "click", function (e) { e.preventDefault(); CLI.acceptRejectCookies(jQuery(this), 'accept'); }); jQuery('.wt-cli-reject-btn').on( "click", function (e) { e.preventDefault(); CLI.acceptRejectCookies(jQuery(this), 'reject'); }); this.settingsPopUp(); this.settingsTabbedAccordion(); this.toggleUserPreferenceCheckBox(); this.hideCookieBarOnClose(); this.cookieLawInfoRunCallBacks(); }, acceptRejectCookies(element, action = 'custom') { var open_link = element[0].hasAttribute("href") && element.attr("href") != '#' ? true : false; var new_window = false; if (action == 'accept') { this.enableAllCookies(); this.accept_close(); new_window = CLI.settings.button_7_new_win ? true : false; } else if (action == 'reject') { this.disableAllCookies(); this.reject_close(); new_window = Boolean(this.settings.button_3_new_win) ? true : false; } else { this.accept_close(); new_window = Boolean(this.settings.button_1_new_win) ? true : false; } if (open_link) { if (new_window) { window.open(element.attr("href"), '_blank'); } else { window.location.href = element.attr("href"); } } }, toggleUserPreferenceCheckBox: function () { jQuery('.cli-user-preference-checkbox').each( function () { categoryCookie = 'cookielawinfo-' + jQuery(this).attr('data-id'); categoryCookieValue = CLI_Cookie.read(categoryCookie); if (categoryCookieValue == null) { if (jQuery(this).is(':checked')) { CLI_Cookie.set(categoryCookie, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); } else { CLI_Cookie.set(categoryCookie, 'no', CLI_ACCEPT_COOKIE_EXPIRE); } } else { if (categoryCookieValue == "yes") { jQuery(this).prop("checked", true); } else { jQuery(this).prop("checked", false); } } } ); jQuery('.cli-user-preference-checkbox').on( "click", function (e) { var dataID = jQuery(this).attr('data-id'); var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id=' + dataID + ']'); if (jQuery(this).is(':checked')) { CLI_Cookie.set('cookielawinfo-' + dataID, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked', true); } else { CLI_Cookie.set('cookielawinfo-' + dataID, 'no', CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked', false); } CLI.checkCategories(); CLI.generateConsent(); } ); }, settingsPopUp: function () { jQuery(document).on( 'click', '.cli_settings_button', function (e) { e.preventDefault(); CLI.settingsModal.addClass("cli-show").css({ 'opacity': 0 }).animate({ 'opacity': 1 }); CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup"); jQuery('body').addClass("cli-modal-open"); jQuery(".cli-settings-overlay").addClass("cli-show"); jQuery("#cookie-law-info-bar").css({ 'opacity': .1 }); if (!jQuery('.cli-settings-mobile').is(':visible')) { CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click"); } } ); jQuery('#cliModalClose').on( "click", function (e) { CLI.settingsPopUpClose(); } ); CLI.settingsModal.on( "click", function (e) { if (!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))) { CLI.settingsPopUpClose(); } } ); jQuery('.cli_enable_all_btn').on( "click", function (e) { var cli_toggle_btn = jQuery(this); var enable_text = cli_toggle_btn.attr('data-enable-text'); var disable_text = cli_toggle_btn.attr('data-disable-text'); if (cli_toggle_btn.hasClass('cli-enabled')) { CLI.disableAllCookies(); cli_toggle_btn.html(enable_text); } else { CLI.enableAllCookies(); cli_toggle_btn.html(disable_text); } jQuery(this).toggleClass('cli-enabled'); } ); this.privacyReadmore(); }, settingsTabbedAccordion: function () { jQuery(".cli-tab-header").on( "click", function (e) { if (!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox'))) { if (jQuery(this).hasClass("cli-tab-active")) { jQuery(this).removeClass("cli-tab-active"); jQuery(this) .siblings(".cli-tab-content") .slideUp(200); } else { jQuery(".cli-tab-header").removeClass("cli-tab-active"); jQuery(this).addClass("cli-tab-active"); jQuery(".cli-tab-content").slideUp(200); jQuery(this) .siblings(".cli-tab-content") .slideDown(200); } } } ); }, settingsPopUpClose: function () { this.settingsModal.removeClass('cli-show'); this.settingsModal.addClass('cli-out'); jQuery('body').removeClass("cli-modal-open"); jQuery(".cli-settings-overlay").removeClass("cli-show"); jQuery("#cookie-law-info-bar").css({ 'opacity': 1 }); }, privacyReadmore: function () { var el = jQuery('.cli-privacy-content .cli-privacy-content-text'); if (el.length > 0) { var clone = el.clone(), originalHtml = clone.html(), originalHeight = el.outerHeight(), Trunc = { addReadmore: function (textBlock) { if (textBlock.html().length > 250) { jQuery('.cli-privacy-readmore').show(); } else { jQuery('.cli-privacy-readmore').hide(); } }, truncateText: function (textBlock) { var strippedText = jQuery('
').html(textBlock.html()); strippedText.find('table').remove(); textBlock.html(strippedText.html()); currentText = textBlock.text(); if (currentText.trim().length > 250) { var newStr = currentText.substring(0, 250); textBlock.empty().html(newStr).append('...'); } }, replaceText: function (textBlock, original) { return textBlock.html(original); } }; Trunc.addReadmore(el); Trunc.truncateText(el); jQuery('a.cli-privacy-readmore').on( "click", function (e) { e.preventDefault(); if (jQuery('.cli-privacy-overview').hasClass('cli-collapsed')) { Trunc.truncateText(el); jQuery('.cli-privacy-overview').removeClass('cli-collapsed'); el.css('height', '100%'); } else { jQuery('.cli-privacy-overview').addClass('cli-collapsed'); Trunc.replaceText(el, originalHtml); } } ); } }, attachDelete: function () { this.delete_link.on( "click", function (e) { CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); for (var k in Cli_Data.nn_cookie_ids) { CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI.generateConsent(); return false; } ); }, configButtons: function () { /*[cookie_button] */ this.main_button.css('color', this.settings.button_1_link_colour); if (Boolean(this.settings.button_1_as_button)) { this.main_button.css('background-color', this.settings.button_1_button_colour); this.main_button.on( 'mouseenter', function () { jQuery(this).css('background-color', CLI.settings.button_1_button_hover); } ) .on( 'mouseleave', function () { jQuery(this).css('background-color', CLI.settings.button_1_button_colour); } ); } /* [cookie_link] */ this.main_link.css('color', this.settings.button_2_link_colour); if (Boolean(this.settings.button_2_as_button)) { this.main_link.css('background-color', this.settings.button_2_button_colour); this.main_link.on( 'mouseenter', function () { jQuery(this).css('background-color', CLI.settings.button_2_button_hover); } ) .on( 'mouseleave', function () { jQuery(this).css('background-color', CLI.settings.button_2_button_colour); } ); } /* [cookie_reject] */ this.reject_link.css('color', this.settings.button_3_link_colour); if (Boolean(this.settings.button_3_as_button)) { this.reject_link.css('background-color', this.settings.button_3_button_colour); this.reject_link.on( 'mouseenter', function () { jQuery(this).css('background-color', CLI.settings.button_3_button_hover); } ) .on( 'mouseleave', function () { jQuery(this).css('background-color', CLI.settings.button_3_button_colour); } ); } /* [cookie_settings] */ this.settings_button.css('color', this.settings.button_4_link_colour); if (Boolean(this.settings.button_4_as_button)) { this.settings_button.css('background-color', this.settings.button_4_button_colour); this.settings_button.on( 'mouseenter', function () { jQuery(this).css('background-color', CLI.settings.button_4_button_hover); } ) .on( 'mouseleave', function () { jQuery(this).css('background-color', CLI.settings.button_4_button_colour); } ); } /* [cookie_accept_all] */ this.accept_all_button.css('color', this.settings.button_7_link_colour); if (this.settings.button_7_as_button) { this.accept_all_button.css('background-color', this.settings.button_7_button_colour); this.accept_all_button.on( 'mouseenter', function () { jQuery(this).css('background-color', CLI.settings.button_7_button_hover); } ) .on( 'mouseleave', function () { jQuery(this).css('background-color', CLI.settings.button_7_button_colour); } ); } }, toggleBar: function () { if (CLI_COOKIEBAR_AS_POPUP) { this.barAsPopUp(1); } if (CLI.settings.cookie_bar_as == 'widget') { this.barAsWidget(1); } if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { this.displayHeader(); } else { this.hideHeader(); } if (Boolean(this.settings.show_once_yn)) { setTimeout( function () { CLI.close_header(); }, CLI.settings.show_once ); } if (CLI.js_blocking_enabled === false) { if (Boolean(Cli_Data.ccpaEnabled) === true) { if (Cli_Data.ccpaType === 'ccpa' && Boolean(Cli_Data.ccpaBarEnabled) === false) { cliBlocker.cookieBar(false); } } else { jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); } } this.showagain_elm.on( "click", function (e) { e.preventDefault(); CLI.showagain_elm.slideUp( CLI.settings.animate_speed_hide, function () { CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); if (CLI_COOKIEBAR_AS_POPUP) { CLI.showPopupOverlay(); } } ); } ); }, configShowAgain: function () { this.showagain_config = { 'background-color': this.settings.background, 'color': this.l1hs(this.settings.text), 'position': 'fixed', 'font-family': this.settings.font_family }; if (Boolean(this.settings.border_on)) { var border_to_hide = 'border-' + this.settings.notify_position_vertical; this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border); this.showagain_config[border_to_hide] = 'none'; } var cli_win = jQuery(window); var cli_winw = cli_win.width(); var showagain_x_pos = this.settings.showagain_x_position; if (cli_winw < 300) { showagain_x_pos = 10; this.showagain_config.width = cli_winw - 20; } else { this.showagain_config.width = 'auto'; } var cli_defw = cli_winw > 400 ? 500 : cli_winw - 20; if (CLI_COOKIEBAR_AS_POPUP) { /* cookie bar as popup */ var sa_pos = this.settings.popup_showagain_position; var sa_pos_arr = sa_pos.split('-'); if (sa_pos_arr[1] == 'left') { this.showagain_config.left = showagain_x_pos; } else if (sa_pos_arr[1] == 'right') { this.showagain_config.right = showagain_x_pos; } if (sa_pos_arr[0] == 'top') { this.showagain_config.top = 0; } else if (sa_pos_arr[0] == 'bottom') { this.showagain_config.bottom = 0; } this.bar_config['position'] = 'fixed'; } else if (this.settings.cookie_bar_as == 'widget') { this.showagain_config.bottom = 0; if (this.settings.widget_position == 'left') { this.showagain_config.left = showagain_x_pos; } else if (this.settings.widget_position == 'right') { this.showagain_config.right = showagain_x_pos; } } else { if (this.settings.notify_position_vertical == "top") { this.showagain_config.top = '0'; } else if (this.settings.notify_position_vertical == "bottom") { this.bar_config['position'] = 'fixed'; this.bar_config['bottom'] = '0'; this.showagain_config.bottom = '0'; } if (this.settings.notify_position_horizontal == "left") { this.showagain_config.left = showagain_x_pos; } else if (this.settings.notify_position_horizontal == "right") { this.showagain_config.right = showagain_x_pos; } } this.showagain_elm.css(this.showagain_config); }, configBar: function () { this.bar_config = { 'background-color': this.settings.background, 'color': this.settings.text, 'font-family': this.settings.font_family }; if (this.settings.notify_position_vertical == "top") { this.bar_config['top'] = '0'; if (Boolean(this.settings.header_fix) === true) { this.bar_config['position'] = 'fixed'; } } else { this.bar_config['bottom'] = '0'; } this.configShowAgain(); this.bar_elm.css(this.bar_config).hide(); }, l1hs: function (str) { if (str.charAt(0) == "#") { str = str.substring(1, str.length); } else { return "#" + str; } return this.l1hs(str); }, close_header: function () { CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); this.hideHeader(); }, accept_close: function () { this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); if (Boolean(this.settings.notify_animate_hide)) { if (CLI.js_blocking_enabled === true) { this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); } else { this.bar_elm.slideUp(this.settings.animate_speed_hide); } } else { if (CLI.js_blocking_enabled === true) { this.bar_elm.hide(0, cliBlocker.runScripts); } else { this.bar_elm.hide(); } } if (Boolean(this.settings.showagain_tab)) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } if (Boolean(this.settings.accept_close_reload) === true) { this.reload_current_page(); } return false; }, reject_close: function () { this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); for (var k in Cli_Data.nn_cookie_ids) { CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'no', CLI_ACCEPT_COOKIE_EXPIRE); if (Boolean(this.settings.notify_animate_hide)) { if (CLI.js_blocking_enabled === true) { this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); } else { this.bar_elm.slideUp(this.settings.animate_speed_hide); } } else { if (CLI.js_blocking_enabled === true) { this.bar_elm.hide(cliBlocker.runScripts); } else { this.bar_elm.hide(); } } if (Boolean(this.settings.showagain_tab)) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } if (Boolean(this.settings.reject_close_reload) === true) { this.reload_current_page(); } return false; }, reload_current_page: function () { window.location.reload(true); }, closeOnScroll: function () { if (window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) { CLI.accept_close(); if (Boolean(CLI.settings.scroll_close_reload) === true) { window.location.reload(); } window.removeEventListener("scroll", CLI.closeOnScroll, false); } }, displayHeader: function () { if (Boolean(this.settings.notify_animate_show)) { this.bar_elm.slideDown(this.settings.animate_speed_show); } else { this.bar_elm.show(); } this.showagain_elm.hide(); if (CLI_COOKIEBAR_AS_POPUP) { this.showPopupOverlay(); } }, hideHeader: function () { if (Boolean(this.settings.showagain_tab)) { if (Boolean(this.settings.notify_animate_show)) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } else { this.showagain_elm.show(); } } else { this.showagain_elm.hide(); } this.bar_elm.slideUp(this.settings.animate_speed_show); this.hidePopupOverlay(); }, hidePopupOverlay: function () { jQuery('body').removeClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").removeClass("cli-show"); }, showPopupOverlay: function () { if (this.bar_elm.length) { if (Boolean(this.settings.popup_overlay)) { jQuery('body').addClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").addClass("cli-show"); } } }, barAsWidget: function (a) { var cli_elm = this.bar_elm; cli_elm.attr('data-cli-type', 'widget'); var cli_win = jQuery(window); var cli_winh = cli_win.height() - 40; var cli_winw = cli_win.width(); var cli_defw = cli_winw > 400 ? 300 : cli_winw - 30; cli_elm.css( { 'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'overflow': 'auto', 'position': 'fixed', 'box-sizing': 'border-box' } ); if (this.checkifStyleAttributeExist() === false) { cli_elm.css({ 'padding': '25px 15px' }); } if (this.settings.widget_position == 'left') { cli_elm.css( { 'left': '15px', 'right': 'auto', 'bottom': '15px', 'top': 'auto' } ); } else { cli_elm.css( { 'left': 'auto', 'right': '15px', 'bottom': '15px', 'top': 'auto' } ); } if (a) { this.setResize(); } }, barAsPopUp: function (a) { if (typeof cookie_law_info_bar_as_popup === 'function') { return false; } var cli_elm = this.bar_elm; cli_elm.attr('data-cli-type', 'popup'); var cli_win = jQuery(window); var cli_winh = cli_win.height() - 40; var cli_winw = cli_win.width(); var cli_defw = cli_winw > 700 ? 500 : cli_winw - 20; cli_elm.css( { 'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'bottom': '', 'top': '50%', 'left': '50%', 'margin-left': (cli_defw / 2) * -1, 'margin-top': '-100px', 'overflow': 'auto' } ).addClass('cli-bar-popup cli-modal-content'); if (this.checkifStyleAttributeExist() === false) { cli_elm.css({ 'padding': '25px 15px' }); } cli_h = cli_elm.height(); li_h = cli_h < 200 ? 200 : cli_h; cli_elm.css({ 'top': '50%', 'margin-top': ((cli_h / 2) + 30) * -1 }); setTimeout( function () { cli_elm.css( { 'bottom': '' } ); }, 100 ); if (a) { this.setResize(); } }, setResize: function () { var resizeTmr = null; jQuery(window).resize( function () { clearTimeout(resizeTmr); resizeTmr = setTimeout( function () { if (CLI_COOKIEBAR_AS_POPUP) { CLI.barAsPopUp(); } if (CLI.settings.cookie_bar_as == 'widget') { CLI.barAsWidget(); } CLI.configShowAgain(); }, 500 ); } ); }, enableAllCookies: function () { jQuery('.cli-user-preference-checkbox').each( function () { var cli_chkbox_elm = jQuery(this); var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); if (cli_chkbox_data_id != 'checkbox-necessary') { cli_chkbox_elm.prop('checked', true); CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); } } ); }, disableAllCookies: function () { jQuery('.cli-user-preference-checkbox').each( function () { var cli_chkbox_elm = jQuery(this); var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); cliCategorySlug = cli_chkbox_data_id.replace('checkbox-', ''); if (Cli_Data.strictlyEnabled.indexOf(cliCategorySlug) === -1) { cli_chkbox_elm.prop('checked', false); CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'no', CLI_ACCEPT_COOKIE_EXPIRE); } } ); }, hideCookieBarOnClose: function () { jQuery(document).on( 'click', '.cli_cookie_close_button', function (e) { e.preventDefault(); var elm = jQuery(this); if (Cli_Data.ccpaType === 'ccpa') { CLI.enableAllCookies(); } CLI.accept_close(); } ); }, checkCategories: function () { var cliAllowedCategories = []; var cli_categories = {}; jQuery('.cli-user-preference-checkbox').each( function () { var status = false; cli_chkbox_elm = jQuery(this); cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', ''); cli_chkbox_data_id_trimmed = cli_chkbox_data_id.replace('-', '_') if (jQuery(cli_chkbox_elm).is(':checked')) { status = true; cliAllowedCategories.push(cli_chkbox_data_id); } cli_categories[cli_chkbox_data_id_trimmed] = status; } ); CLI.allowedCategories = cliAllowedCategories; }, cookieLawInfoRunCallBacks: function () { this.checkCategories(); if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes') { if ("function" == typeof CookieLawInfo_Accept_Callback) { CookieLawInfo_Accept_Callback(); } } }, generateConsent: function () { var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); cliConsent = {}; if (preferenceCookie !== null) { cliConsent = window.atob(preferenceCookie); cliConsent = JSON.parse(cliConsent); } cliConsent.ver = Cli_Data.consentVersion; categories = []; jQuery('.cli-user-preference-checkbox').each( function () { categoryVal = ''; cli_chkbox_data_id = jQuery(this).attr('data-id'); cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', ''); if (jQuery(this).is(':checked')) { categoryVal = true; } else { categoryVal = false; } cliConsent[cli_chkbox_data_id] = categoryVal; } ); cliConsent = JSON.stringify(cliConsent); cliConsent = window.btoa(cliConsent); CLI_Cookie.set(CLI_PREFERNCE_COOKIE, cliConsent, CLI_ACCEPT_COOKIE_EXPIRE); }, addStyleAttribute: function () { var bar = this.bar_elm; var styleClass = ''; if (jQuery(bar).find('.cli-bar-container').length > 0) { styleClass = jQuery('.cli-bar-container').attr('class'); styleClass = styleClass.replace('cli-bar-container', ''); styleClass = styleClass.trim(); jQuery(bar).attr('data-cli-style', styleClass); } }, getParameterByName: function (name, url) { if (!url) { url = window.location.href; } name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) { return null; } if (!results[2]) { return ''; } return decodeURIComponent(results[2].replace(/\+/g, ' ')); }, CookieLawInfo_Callback: function (enableBar, enableBlocking) { enableBar = typeof enableBar !== 'undefined' ? enableBar : true; enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true; if (CLI.js_blocking_enabled === true && Boolean(Cli_Data.custom_integration) === true) { cliBlocker.cookieBar(enableBar); cliBlocker.runScripts(enableBlocking); } }, checkifStyleAttributeExist: function () { var exist = false; var attr = this.bar_elm.attr('data-cli-style'); if (typeof attr !== typeof undefined && attr !== false) { exist = true; } return exist; }, reviewConsent: function () { jQuery(document).on( 'click', '.cli_manage_current_consent,.wt-cli-manage-consent-link', function () { CLI.displayHeader(); } ); }, mayBeSetPreferenceCookie: function () { if (CLI.getParameterByName('cli_bypass') === "1") { CLI.generateConsent(); } } } var cliBlocker = { blockingStatus: true, scriptsLoaded: false, ccpaEnabled: false, ccpaRegionBased: false, ccpaApplicable: false, ccpaBarEnabled: false, cliShowBar: true, isBypassEnabled: CLI.getParameterByName('cli_bypass'), checkPluginStatus: function (callbackA, callbackB) { this.ccpaEnabled = Boolean(Cli_Data.ccpaEnabled); this.ccpaRegionBased = Boolean(Cli_Data.ccpaRegionBased); this.ccpaBarEnabled = Boolean(Cli_Data.ccpaBarEnabled); if (Boolean(Cli_Data.custom_integration) === true) { callbackA(false); } else { if (this.ccpaEnabled === true) { this.ccpaApplicable = true; if (Cli_Data.ccpaType === 'ccpa') { if (this.ccpaBarEnabled !== true) { this.cliShowBar = false; this.blockingStatus = false; } } } else { jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); } if (cliBlocker.isBypassEnabled === "1") { cliBlocker.blockingStatus = false; } callbackA(this.cliShowBar); callbackB(this.blockingStatus); } }, cookieBar: function (showbar) { showbar = typeof showbar !== 'undefined' ? showbar : true; cliBlocker.cliShowBar = showbar; if (cliBlocker.cliShowBar === false) { CLI.bar_elm.hide(); CLI.showagain_elm.hide(); CLI.settingsModal.removeClass('cli-blowup cli-out'); CLI.hidePopupOverlay(); jQuery(".cli-settings-overlay").removeClass("cli-show"); } else { if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { CLI.displayHeader(); } else { CLI.hideHeader(); } } }, removeCookieByCategory: function () { if (cliBlocker.blockingStatus === true) { if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) { var non_necessary_cookies = Cli_Data.non_necessary_cookies; for (var key in non_necessary_cookies) { currentCategory = key; if (CLI.allowedCategories.indexOf(currentCategory) === -1) { var nonNecessaryCookies = non_necessary_cookies[currentCategory]; for (var i = 0; i < nonNecessaryCookies.length; i++) { if (CLI_Cookie.read(nonNecessaryCookies[i]) !== null) { CLI_Cookie.erase(nonNecessaryCookies[i]); } } } } } } }, runScripts: function (blocking) { blocking = typeof blocking !== 'undefined' ? blocking : true; cliBlocker.blockingStatus = blocking; srcReplaceableElms = ['iframe', 'IFRAME', 'EMBED', 'embed', 'OBJECT', 'object', 'IMG', 'img']; var genericFuncs = { renderByElement: function (callback) { cliScriptFuncs.renderScripts(); callback(); cliBlocker.scriptsLoaded = true; }, }; var cliScriptFuncs = { // trigger DOMContentLoaded scriptsDone: function () { if (typeof Cli_Data.triggerDomRefresh !== 'undefined') { if (Boolean(Cli_Data.triggerDomRefresh) === true) { var DOMContentLoadedEvent = document.createEvent('Event') DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true) window.document.dispatchEvent(DOMContentLoadedEvent); } } }, seq: function (arr, callback, index) { // first call, without an index if (typeof index === 'undefined') { index = 0 } arr[index]( function () { index++ if (index === arr.length) { callback() } else { cliScriptFuncs.seq(arr, callback, index) } } ) }, /* script runner */ insertScript: function ($script, callback) { var s = ''; var scriptType = $script.getAttribute('data-cli-script-type'); var elementPosition = $script.getAttribute('data-cli-element-position'); var isBlock = $script.getAttribute('data-cli-block'); var s = document.createElement('script'); var ccpaOptedOut = cliBlocker.ccpaOptedOut(); s.type = 'text/plain'; if ($script.async) { s.async = $script.async; } if ($script.defer) { s.defer = $script.defer; } if ($script.src) { s.onload = callback s.onerror = callback s.src = $script.src } else { s.textContent = $script.innerText } var attrs = jQuery($script).prop("attributes"); for (var ii = 0; ii < attrs.length; ++ii) { if (attrs[ii].nodeName !== 'id') { s.setAttribute(attrs[ii].nodeName, attrs[ii].value); } } if (cliBlocker.blockingStatus === true) { if ((CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes' && CLI.allowedCategories.indexOf(scriptType) !== -1)) { s.setAttribute('data-cli-consent', 'accepted'); s.type = 'text/javascript'; } if (cliBlocker.ccpaApplicable === true) { if (ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null) { s.type = 'text/plain'; } } } else { s.type = 'text/javascript'; } if ($script.type != s.type) { if (elementPosition === 'head') { document.head.appendChild(s); } else { document.body.appendChild(s); } if (!$script.src) { callback() } $script.parentNode.removeChild($script); } else { callback(); } }, renderScripts: function () { var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]'); if ($scripts.length > 0) { var runList = [] var typeAttr Array.prototype.forEach.call( $scripts, function ($script) { // only run script tags without the type attribute // or with a javascript mime attribute value typeAttr = $script.getAttribute('type') runList.push( function (callback) { cliScriptFuncs.insertScript($script, callback) } ) } ) cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone); } } }; genericFuncs.renderByElement(cliBlocker.removeCookieByCategory); }, ccpaOptedOut: function () { var ccpaOptedOut = false; var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); if (preferenceCookie !== null) { cliConsent = window.atob(preferenceCookie); cliConsent = JSON.parse(cliConsent); if (typeof cliConsent.ccpaOptout !== 'undefined') { ccpaOptedOut = cliConsent.ccpaOptout; } } return ccpaOptedOut; } } jQuery(document).ready( function () { if (typeof cli_cookiebar_settings != 'undefined') { CLI.set( { settings: cli_cookiebar_settings } ); if (CLI.js_blocking_enabled === true) { cliBlocker.checkPluginStatus(cliBlocker.cookieBar, cliBlocker.runScripts); } } } ); // source --> https://www.absorve.com.br/site2019/wp-content/plugins/print-o-matic/printomat.js?ver=1.8.6 /*! * Print-O-Matic JavaScript v1.8.6 * http://plugins.twinpictures.de/plugins/print-o-matic/ * * Copyright 2017, Twinpictures * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, blend, trade, * bake, hack, scramble, difiburlate, digest and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ jQuery(document).ready(function() { jQuery('.printomatic, .printomatictext').click(function() { var id = jQuery(this).attr('id'); var target = jQuery(this).data('print_target'); if(!target){ target = jQuery('#target-' + id).val(); } if (target == '%prev%') { target = jQuery(this).prev(); } if (target == '%next%') { target = jQuery(this).next(); } var w = window.open('', 'printomatic print page', 'status=no, toolbar=no, menubar=no, location=no'); var print_html = '' + document.getElementsByTagName('title')[0].innerHTML + ''; if ( typeof print_data != 'undefined' && typeof print_data[id] != 'undefined'){ if ( 'pom_site_css' in print_data[id] && print_data[id]['pom_site_css'] ){ print_html += ''; } if ( 'pom_custom_css' in print_data[id] && print_data[id]['pom_custom_css']){ print_html += ''; } //build the blank page w.document.open(); w.document.write( print_html + ''); w.document.close(); if ( 'pom_do_not_print' in print_data[id] && print_data[id]['pom_do_not_print'] ){ jQuery(print_data[id]['pom_do_not_print']).hide(); } if ( 'pom_html_top' in print_data[id] && print_data[id]['pom_html_top']){ jQuery(w.document.body).html( print_data[id]['pom_html_top'] ); } } var ua = window.navigator.userAgent; var ie = true; //rot in hell IE if ( ua.indexOf("MSIE ") != -1) { //alert('MSIE - Craptastic'); jQuery(w.document.body).append( jQuery( target ).clone( true ).html() ); } else if ( ua.indexOf("Trident/") != -1) { //console.log('IE 11 - Trident'); jQuery(w.document.body).append( jQuery( target ).clone( true ).html() ); } else if ( ua.indexOf("Edge/") != -1 ){ //console.log('IE 12 - Edge'); //there is a bug in Edge where no nested elements can be appended. jQuery( target ).each(function(){ var s = jQuery.trim( jQuery( this ).clone( true ).html() ); jQuery( w.document.body ).append( s ); }); } else{ //console.log('good browser'); jQuery(w.document.body).append( jQuery( target ).clone( true ) ); ie = false; } if ( typeof print_data != 'undefined' && typeof print_data[id] != 'undefined'){ if ( 'pom_do_not_print' in print_data[id] ){ jQuery( print_data[id]['pom_do_not_print']).show(); } if ( 'pom_html_bottom' in print_data[id] && print_data[id]['pom_html_bottom']){ jQuery(w.document.body).append( jQuery.trim( print_data[id]['pom_html_bottom'] ) ); } } //for IE cycle through and fill in any text input values... rot in hell IE if(ie){ jQuery( target ).find('input[type=text]').each(function() { var user_val = jQuery(this).val(); if(user_val){ var elem_id = jQuery(this).attr('id'); if(elem_id){ w.document.getElementById(elem_id).value = user_val; } else{ //we really should have a ID, let's try and grab the element by name attr. var elem_name = jQuery(this).attr('name'); if(elem_name.length){ named_elements = w.document.getElementsByName(elem_name); named_elements[0].value = user_val; } } } }); //select values? jQuery( target ).find('select').each(function(i) { console.log('found one: ' + i); var sel_val = jQuery(this).val(); console.log('value is: ' + sel_val); if(sel_val){ var elem_id = jQuery(this).attr('id'); if(elem_id){ w.document.getElementById(elem_id).value = sel_val; } } }); } /* hardcodeed iframe and if so, force a pause... pro version offers more options */ iframe = jQuery(w.document).find('iframe'); if (iframe.length && typeof print_data != 'undefined' && typeof print_data[id] != 'undefined') { if('pom_pause_time' in print_data[id] && print_data[id]['pom_pause_time'] < 3000){ print_data[id]['pom_pause_time'] = 3000; } else if(print_data[id]['pom_pause_time'] === 'undefined'){ print_data[id]['pom_pause_time'] = 3000; } } if(typeof print_data != 'undefined' && typeof print_data[id] != 'undefined' && 'pom_pause_time' in print_data[id] && print_data[id]['pom_pause_time'] > 0){ pause_time = setTimeout(printIt, print_data[id]['pom_pause_time']); } else{ printIt(); } function printIt(){ w.focus(); w.print(); if('pom_close_after_print' in print_data[id] && print_data[id]['pom_close_after_print'] == '1'){ //need a bit of a pause to let safari on iOS render the print privew properly setTimeout( function() { w.close() }, 1000 ); } } }); }); // source --> https://www.absorve.com.br/site2019/wp-content/plugins/responsive-lightbox/assets/prettyphoto/js/jquery.prettyPhoto.js?ver=1.7.2 /* ------------------------------------------------------------------------ Class: prettyPhoto Use: Lightbox clone for jQuery Author: Stephane Caron (http://www.no-margin-for-errors.com) Version: 3.1.6 ------------------------------------------------------------------------- */ (function($) { $.prettyPhoto = {version: '3.1.6'}; $.fn.prettyPhoto = function(pp_settings) { pp_settings = jQuery.extend({ hook: 'rel', /* the attribute tag to use for prettyPhoto hooks. default: 'rel'. For HTML5, use "data-rel" or similar. */ animation_speed: 'fast', /* fast/slow/normal */ ajaxcallback: function() {}, slideshow: 5000, /* false OR interval time in ms */ autoplay_slideshow: false, /* true/false */ opacity: 0.80, /* Value between 0 and 1 */ show_title: true, /* true/false */ allow_resize: true, /* Resize the photos bigger than viewport. true/false */ allow_expand: true, /* Allow the user to expand a resized image. true/false */ default_width: 500, default_height: 344, counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ horizontal_padding: 20, /* The padding on each side of the picture */ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ wmode: 'opaque', /* Set the flash wmode attribute */ autoplay: true, /* Automatically start videos: True/False */ modal: false, /* If set to true, only the close button will close the window */ deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */ overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ overlay_gallery_max: 30, /* Maximum number of pictures in the overlay gallery */ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ changepicturecallback: function(){}, /* Called everytime an item is shown/changed */ callback: function(){}, /* Called when prettyPhoto is closed */ ie6_fallback: true, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\
{pp_social}
\ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: '
' /* html or false to disable */ }, pp_settings); var isMobile = { Android: function() { return navigator.userAgent.match( /Android/i ); }, BlackBerry: function() { return navigator.userAgent.match( /BlackBerry/i ); }, iOS: function() { return navigator.userAgent.match( /iPhone|iPad|iPod/i ); }, Opera: function() { return navigator.userAgent.match( /Opera Mini/i ); }, Windows: function() { return navigator.userAgent.match( /IEMobile/i ); }, any: function() { return ( isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows() ); } }; function fitToMobileViewport( newWindowWidth, newWindowHeight, imgWidth, imgHeight ) { var newHeight = 0, newWidth = 0; if ( imgWidth > imgHeight ) { newWidth = newWindowWidth; newHeight = Math.round( imgHeight * newWindowWidth / imgWidth ); } else { newWidth = Math.round( imgWidth * newWindowHeight / imgHeight ); newHeight = newWindowHeight; } return _fitToViewport( newWidth, newHeight ); } // Global variables accessible only by prettyPhoto var matchedObjects = this, percentBased = false, pp_dimensions, pp_open, // prettyPhoto container specific pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, // Window size windowHeight = $(window).height(), windowWidth = $(window).width(), // Global elements pp_slideshow; doresize = true, scroll_pos = _get_scroll(); // Window/Keyboard events $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); }); if(pp_settings.keyboard_shortcuts) { $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){ if(typeof $pp_pic_holder != 'undefined'){ if($pp_pic_holder.is(':visible')){ switch(e.keyCode){ case 37: $.prettyPhoto.changePage('previous'); e.preventDefault(); break; case 39: $.prettyPhoto.changePage('next'); e.preventDefault(); break; case 27: if(!settings.modal) $.prettyPhoto.close(); e.preventDefault(); break; }; // return false; }; }; }); }; /** * Initialize prettyPhoto. */ $.prettyPhoto.initialize = function() { settings = pp_settings; if(settings.theme == 'pp_default') settings.horizontal_padding = 16; // Find out if the picture is part of a set theRel = $(this).attr(settings.hook); galleryRegExp = /\-(?:.*)/; isSet = (galleryRegExp.exec(theRel)) ? true : false; // Put the SRCs, TITLEs, ALTs into an array. pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href')); pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt')); pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title')); if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery = false; set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned rel_index = (isSet) ? set_position : $("a["+settings.hook+"^='"+theRel+"']").index($(this)); _build_overlay(this); // Build the overlay {this} being the caller if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); }); $.prettyPhoto.open(); return false; } /** * Opens the prettyPhoto modal box. * @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths. * @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles. * @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions. */ $.prettyPhoto.open = function(event) { if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables settings = pp_settings; pp_images = $.makeArray(arguments[0]); pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray(""); pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray(""); isSet = (pp_images.length > 1) ? true : false; set_position = (arguments[3])? arguments[3]: 0; _build_overlay(event.target); // Build the overlay {this} being the caller } if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); // Hide the flash _checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images. $('.pp_loaderIcon').show(); if(settings.deeplinking) setHashtag(); // Rebuild Facebook Like Button with updated href if(settings.social_tools){ facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); $pp_pic_holder.find('.pp_social').html(facebook_like_link); } // Fade the content in if($ppt.is(':hidden')) $ppt.css('opacity',0).show(); $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity); // Display the current position $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size()); // Set the description if(typeof pp_descriptions[set_position] != 'undefined' && pp_descriptions[set_position] != ""){ $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position])); }else{ $pp_pic_holder.find('.pp_description').hide(); } // Get the dimensions movie_width = ( parseFloat(getParam('width',pp_images[set_position])) ) ? getParam('width',pp_images[set_position]) : settings.default_width.toString(); movie_height = ( parseFloat(getParam('height',pp_images[set_position])) ) ? getParam('height',pp_images[set_position]) : settings.default_height.toString(); // If the size is % based, calculate according to window dimensions percentBased=false; if(movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; } if(movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; } // Fade the holder $pp_pic_holder.fadeIn(function(){ // Set the title (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(' '); imgPreloader = ""; skipInjection = false; // Inject the proper content switch(_getFileType(pp_images[set_position])){ case 'image': imgPreloader = new Image(); // Preload the neighbour images nextImage = new Image(); if(isSet && set_position < $(pp_images).size() -1) nextImage.src = pp_images[set_position + 1]; prevImage = new Image(); if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1]; $pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup.replace(/{path}/g,pp_images[set_position]); imgPreloader.onload = function() { // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), imgPreloader.width, imgPreloader.height ); else pp_dimensions = _fitToViewport(imgPreloader.width,imgPreloader.height); _showContent(); }; imgPreloader.onerror = function(){ alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto.close(); }; imgPreloader.src = pp_images[set_position]; break; case 'youtube': // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); // Regular youtube link movie_id = getParam('v',pp_images[set_position]); // youtu.be link if(movie_id == ""){ movie_id = pp_images[set_position].split('youtu.be/'); movie_id = movie_id[1]; if(movie_id.indexOf('?') > 0) movie_id = movie_id.substr(0,movie_id.indexOf('?')); // Strip anything after the ? if(movie_id.indexOf('&') > 0) movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the & } movie = '//www.youtube.com/embed/'+movie_id; (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1"; if(settings.autoplay) movie += "&autoplay=1"; toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie); break; case 'vimeo': // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); movie_id = pp_images[set_position]; var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; var match = movie_id.match(regExp); movie = '//player.vimeo.com/video/'+ match[3] +'?title=0&byline=0&portrait=0'; if(settings.autoplay) movie += "&autoplay=1;"; vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width']; toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie); break; case 'quicktime': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; // Add space for the control bar toInject = settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'flash': // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); flash_vars = pp_images[set_position]; flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length); filename = pp_images[set_position]; filename = filename.substring(0,filename.indexOf('?')); toInject = settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars); break; case 'iframe': // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); frame_url = pp_images[set_position]; frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1); toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url); break; case 'ajax': doresize = false; // Make sure the dimensions are not resized. // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); doresize = true; // Reset the dimensions skipInjection = true; $.get(pp_images[set_position],function(responseHTML){ toInject = settings.inline_markup.replace(/{content}/g,responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; _showContent(); }); break; case 'custom': // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), movie_width, movie_height ); else pp_dimensions = _fitToViewport( movie_width, movie_height ); toInject = settings.custom_markup; break; case 'inline': // to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete myClone = $(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show(); doresize = false; // Make sure the dimensions are not resized. // Fit item to viewport if ( isMobile.any() ) pp_dimensions = fitToMobileViewport( Math.round( windowWidth * 0.9 ), Math.round( windowHeight * 0.9 ), $(myClone).width(), $(myClone).height() ); else pp_dimensions = _fitToViewport( $(myClone).width(), $(myClone).height() ); doresize = true; // Reset the dimensions $(myClone).remove(); toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html()); break; }; if(!imgPreloader && !skipInjection){ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; // Show content _showContent(); }; }); return false; }; /** * Change page in the prettyPhoto modal box * @param direction {String} Direction of the paging, previous or next. */ $.prettyPhoto.changePage = function(direction){ currentGalleryPage = 0; if(direction == 'previous') { set_position--; if (set_position < 0) set_position = $(pp_images).size()-1; }else if(direction == 'next'){ set_position++; if(set_position > $(pp_images).size()-1) set_position = 0; }else{ set_position=direction; }; rel_index = set_position; if(!doresize) doresize = true; // Allow the resizing of the images if(settings.allow_expand) { $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); } _hideContent(function(){ $.prettyPhoto.open(); }); }; /** * Change gallery page in the prettyPhoto modal box * @param direction {String} Direction of the paging, previous or next. */ $.prettyPhoto.changeGalleryPage = function(direction){ if(direction=='next'){ currentGalleryPage ++; if(currentGalleryPage > totalPage) currentGalleryPage = 0; }else if(direction=='previous'){ currentGalleryPage --; if(currentGalleryPage < 0) currentGalleryPage = totalPage; }else{ currentGalleryPage = direction; }; slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0; slide_to = currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({left:-slide_to},slide_speed); }; /** * Start the slideshow... */ $.prettyPhoto.startSlideshow = function(){ if(typeof pp_slideshow == 'undefined'){ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){ $.prettyPhoto.stopSlideshow(); return false; }); pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow); }else{ $.prettyPhoto.changePage('next'); }; } /** * Stop the slideshow... */ $.prettyPhoto.stopSlideshow = function(){ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow=undefined; } /** * Closes prettyPhoto. */ $.prettyPhoto.close = function(){ if($pp_overlay.is(":animated")) return; $.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility','hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function(){ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); // Show the flash $(this).remove(); // No more need for the prettyPhoto markup $(window).unbind('scroll.prettyphoto'); clearHashtag(); settings.callback(); doresize = true; pp_open = false; delete settings; }); }; /** * Set the proper sizes on the containers and animate the content in. */ function _showContent(){ $('.pp_loaderIcon').hide(); // Calculate the opened top position of the pic holder projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2)); if(projectedTop < 0) projectedTop = 0; $ppt.fadeTo(settings.animation_speed,1); // Resize the content holder $pp_pic_holder.find('.pp_content') .animate({ height:pp_dimensions['contentHeight'], width:pp_dimensions['contentWidth'] },settings.animation_speed); // Resize picture the holder $pp_pic_holder.animate({ 'top': projectedTop, 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2), width:pp_dimensions['containerWidth'] },settings.animation_speed,function(){ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']); $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content // Show the nav if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); } if(settings.allow_expand) { if(pp_dimensions['resized']){ // Fade the resizing link if the image is resized $('a.pp_expand,a.pp_contract').show(); }else{ $('a.pp_expand').hide(); } } if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow(); settings.changepicturecallback(); // Callback! pp_open = true; }); _insert_gallery(); pp_settings.ajaxcallback(); }; /** * Hide the content...DUH! */ function _hideContent(callback){ // Fade out the current picture $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden'); $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){ $('.pp_loaderIcon').show(); callback(); }); }; /** * Check the item position in the gallery array, hide or show the navigation links * @param setCount {integer} The total number of items in the set */ function _checkPosition(setCount){ (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set. }; /** * Resize the item dimensions if it's bigger than the viewport * @param width {integer} Width of the item to be opened * @param height {integer} Height of the item to be opened * @return An array containin the "fitted" dimensions */ function _fitToViewport(width,height){ resized = false; _getDimensions(width,height); // Define them in case there's no resize needed imageWidth = width, imageHeight = height; if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) { resized = true, fitting = false; while (!fitting){ if((pp_containerWidth > windowWidth)){ imageWidth = (windowWidth - 200); imageHeight = (height/width) * imageWidth; }else if((pp_containerHeight > windowHeight)){ imageHeight = (windowHeight - 200); imageWidth = (width/height) * imageHeight; }else{ fitting = true; }; pp_containerHeight = imageHeight, pp_containerWidth = imageWidth; }; if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; _getDimensions(imageWidth,imageHeight); }; return { width:Math.floor(imageWidth), height:Math.floor(imageHeight), containerHeight:Math.floor(pp_containerHeight), containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight:Math.floor(pp_contentHeight), contentWidth:Math.floor(pp_contentWidth), resized:resized }; }; /** * Get the containers dimensions according to the item size * @param width {integer} Width of the item to be opened * @param height {integer} Height of the item to be opened */ function _getDimensions(width,height){ width = parseFloat(width); height = parseFloat(height); // Get the details height, to do so, I need to clone it since it's invisible $pp_details = $pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); detailsHeight += $pp_details.height(); detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details $pp_details.remove(); // Get the titles height, to do so, I need to clone it since it's invisible $pp_title = $pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title = $pp_title.clone().appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); titleHeight += $pp_title.height(); $pp_title.remove(); // Get the container size, to resize the holder to the right dimensions pp_contentHeight = height + detailsHeight; pp_contentWidth = width; pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth = width; } function _getFileType(itemSrc){ if (itemSrc.match(/youtube\.com\/watch/i) || itemSrc.match(/youtu\.be/i)) { return 'youtube'; }else if (itemSrc.match(/vimeo\.com/i)) { return 'vimeo'; }else if(itemSrc.match(/\b.mov\b/i)){ return 'quicktime'; }else if(itemSrc.match(/\b.swf\b/i)){ return 'flash'; }else if(itemSrc.match(/\biframe=true\b/i)){ return 'iframe'; }else if(itemSrc.match(/\bajax=true\b/i)){ return 'ajax'; }else if(itemSrc.match(/\bcustom=true\b/i)){ return 'custom'; }else if(itemSrc.substr(0,1) == '#'){ return 'inline'; }else{ return 'image'; }; }; function _center_overlay(){ if(doresize && typeof $pp_pic_holder != 'undefined') { scroll_pos = _get_scroll(); contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2); if(projectedTop < 0) projectedTop = 0; if(contentHeight > windowHeight) return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2) }); }; }; function _get_scroll(){ if (self.pageYOffset) { return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}; } else if (document.body) {// all other Explorers return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}; }; }; function _resize_overlay() { windowHeight = $(window).height(), windowWidth = $(window).width(); if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery(){ if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") { itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin. navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; // Define the arrow width depending on the theme itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length; totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1; // Hide the nav in the case there's no need for links if(totalPage == 0){ navWidth = 0; // No nav means no width! $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide(); }else{ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show(); }; galleryWidth = itemsPerPage * itemWidth; fullGalleryWidth = pp_images.length * itemWidth; // Set the proper width to the gallery items $pp_gallery .css('margin-left',-((galleryWidth/2) + (navWidth/2))) .find('div:first').width(galleryWidth+5) .find('ul').width(fullGalleryWidth) .find('li.selected').removeClass('selected'); goToPage = (Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage) : totalPage; $.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected'); }else{ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); // $pp_gallery.hide(); } } function _build_overlay(caller){ // Inject Social Tool markup into General markup if(settings.social_tools) facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); settings.markup = settings.markup.replace('{pp_social}',''); $('body').append(settings.markup); // Inject the markup $pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors // Inject the inline gallery! if(isSet && settings.overlay_gallery) { currentGalleryPage = 0; toInject = ""; for (var i=0; i < pp_images.length; i++) { if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname = 'default'; img_src = ''; }else{ classname = ''; img_src = pp_images[i]; } toInject += "
  • "; }; toInject = settings.gallery_markup.replace(/{gallery}/g,toInject); $pp_pic_holder.find('#pp_full_res').after(toInject); $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors $pp_gallery.find('.pp_arrow_next').click(function(){ $.prettyPhoto.changeGalleryPage('next'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function(){ $.prettyPhoto.changeGalleryPage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_content').hover( function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn(); }, function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut(); }); itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin. $pp_gallery_li.each(function(i){ $(this) .find('a') .click(function(){ $.prettyPhoto.changePage(i); $.prettyPhoto.stopSlideshow(); return false; }); }); }; // Inject the play/pause if it's a slideshow if(settings.slideshow){ $pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); } $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme $pp_overlay .css({ 'opacity':0, 'height':$(document).height(), 'width':$(window).width() }) .bind('click',function(){ if(!settings.modal) $.prettyPhoto.close(); }); $('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; }); if(settings.allow_expand) { $('a.pp_expand').bind('click',function(e){ // Expand the image if($(this).hasClass('pp_expand')){ $(this).removeClass('pp_expand').addClass('pp_contract'); doresize = false; }else{ $(this).removeClass('pp_contract').addClass('pp_expand'); doresize = true; }; _hideContent(function(){ $.prettyPhoto.open(); }); return false; }); } $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){ $.prettyPhoto.changePage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){ $.prettyPhoto.changePage('next'); $.prettyPhoto.stopSlideshow(); return false; }); _center_overlay(); // Center it }; if(!pp_alreadyInitialized && getHashtag()){ pp_alreadyInitialized = true; // Grab the rel index to trigger the click on the correct element hashIndex = getHashtag(); hashRel = hashIndex; hashIndex = hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1); hashRel = hashRel.substring(0,hashRel.indexOf('/')); // Little timeout to make sure all the prettyPhoto initialize scripts has been run. // Useful in the event the page contain several init scripts. setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50); } return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once }; function getHashtag(){ var url = location.href; hashtag = (url.indexOf('#prettyPhoto') !== -1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)) : false; if(hashtag){ hashtag = hashtag.replace(/<|>/g,''); } return hashtag; }; function setHashtag(){ if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API location.hash = theRel + '/'+rel_index+'/'; }; function clearHashtag(){ if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto"; } function getParam(name,url){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( url ); return ( results == null ) ? "" : results[1]; } })(jQuery); var pp_alreadyInitialized = false; // Used for the deep linking to make sure not to call the same function several times.;